from google.appengine.ext import db

class Article(db.Model):
    id_title = db.StringProperty(required=True)
    title = db.StringProperty(required=True)
    content = db.TextProperty(required=True)
    author = db.StringProperty(required=True)
    image = db.StringProperty(required=True)
    date_creation = db.DateTimeProperty(auto_now_add=True)
    source = db.StringListProperty()
    
    def min_content(self):
        return self.content[:300]
    
    